#include <iostream>
#include <stack>
#include <cstring>
using namespace std;
double op(double n1,double n2,char ra);
int main() {
	stack<double> num;
	stack<char> s;
	char io[1000] = {0};
	fgets(io, 1000, stdin);
	for(int i = 0; i<strlen(io); i++) {
		if(io[i]>='0' && io[i]<='9') {
			num.push((double)io[i]-48);
			i++;
			int a=1;
			double n;
			while(io[i]>='0' && io[i]<='9') {
				n = num.top();
				n*=10;
				n+=io[i]-48;
				a++;
				i++;
				num.pop();
				num.push(n);
			}
			i--;
		}
		else if(io[i] == '+' || io[i] == '-' || io[i] == '*' || io[i] == '/' || io[i] == '(' || io[i] == ')') {
			if(s.empty()) s.push(io[i]);
			else { 
				if((io[i]==')'&&s.top()=='(')) s.pop();
				else if(io[i]=='('||s.top()=='('||((io[i]=='*'||io[i]=='/')&&(s.top()=='+'||s.top()=='-')))s.push(io[i]);
				else {
					double n1 = num.top();
					num.pop();
					double n2 = num.top();
					num.pop();
					char opera = s.top();
					s.pop();
					num.push(op(n1,n2,opera));
					s.push(io[i]);
				}
			}
		}
	}
	while(!s.empty()) {
		char opera = s.top();
		s.pop();
		if(opera!='('&&opera!=')'){
		double n1 = num.top();
		num.pop();
		double n2 = num.top();
		num.pop();
		num.push(op(n1,n2,opera));	
		}
	}
	printf("%lf",num.top());
}
double op(double n1,double n2,char opera) {
	switch(opera) {
		case '+':
			return n2+n1;
		case'-':
			return n2-n1;
		case'*':
			return n2*n1;
		case'/':
			return n2/n1;
	}
}